package entities;

public class Session {
	private int id;
	private int startSlot = 0;
	private int endSlot = 0;
	
	public Session() {}

	public Session(int id, int startSlot, int endSlot) {
		super();
		this.setId(id);
		this.setStartSlot(startSlot);
		this.setEndSlot(endSlot);
	}
	
	public void setId(int id) {
		this.id = id;
	}

	public int getId() {
		return id;
	}

	public void setStartSlot(int startSlot) {
		this.startSlot = startSlot;
	}

	public int getStartSlot() {
		return startSlot;
	}

	public void setEndSlot(int endSlot) {
		this.endSlot = endSlot;
	}

	public int getEndSlot() {
		return endSlot;
	}

	public String getDay() {
		int day = startSlot/10 + 1;
		switch (day) {
			case 1 : return "Sunday";
			case 2 : return "Monday";
			case 3 : return "Tuesday";
			case 4 : return "Wednesday";
			case 5 : return "Thursday";
			case 6 : return "Friday";
			case 7 : return "Saturday";
			default : return "Noday";
		}
	}

	public String getStartTime() {
		return getTime(startSlot, false);
	}
	
	public String getEndTime() {
		return getTime(endSlot, true);
	}

	private String getTime(int slot, boolean isEnd) {
		int time = slot % 10 + 1;
		switch (time) {
			case 1 : return (isEnd)?"19:00":"9:00";
			case 2 : return "10:00";
			case 3 : return "11:00";
			case 4 : return "12:00";
			case 5 : return "13:00";
			case 6 : return "14:00";
			case 7 : return "15:00";
			case 8 : return "16:00";
			case 9 : return "17:00";
			case 10 : return "18:00";
			default : return "00:00";
		}
	}
	
	public String getDayAndTimes() {
		return this.getDay() + " " + this.getStartTime() + " - " + this.getEndTime() + "";
	}
}
